package basic.thread.again;

/**
 * @author bingo
 * @create 2018-02-09 12:27
 **/
public class Demo1 extends Thread {
    @Override
    public void run() {
        while (!isInterrupted()){

            System.out.println(Thread.currentThread().getName()+"执行了");
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }

    public static void main(String[] args)  {

        Demo1 d1 = new Demo1();
        Demo1 d2 = new Demo1();
        d1.start();
        d2.start();

      d1.interrupt();


    }
}
